package org.shoukaiseki.supersaiyan.db.inittable.system;

import org.shoukaiseki.inittable.domain.TableColumnInfo;
import org.shoukaiseki.inittable.domain.TableIndexInfo;
import org.shoukaiseki.inittable.service.ITableBuildInfoService;
import org.shoukaiseki.kakaroto.SksDictUtils;
import org.shoukaiseki.kakaroto.annotation.TableBuild;
import org.shoukaiseki.supersaiyan.enums.Sks0Enable1Deactivate;

import java.util.List;

import static org.shoukaiseki.inittable.utils.SksColumnCamelCaseCommon.*;
import static org.shoukaiseki.inittable.utils.TableColumnInfoBuilder.column;
import static org.shoukaiseki.inittable.utils.TableIndexInfoBuilder.uniqueIndex;
import static org.shoukaiseki.inittable.utils.TableInfoUtils.tableColumns;
import static org.shoukaiseki.inittable.utils.TableInfoUtils.tableIndexs;

/**
 * OK
 * org.shoukaiseki.supersaiyan.db.inittable.system.SysOrgInitTable
 * <br>
 *
 * @author shoukaiseki blog http://www.shoukaiseki.top/<br> E-mail jiang28555@Gmail.com<br>
 * @date 2022-10-15 14:19:40<br>
 */
@TableBuild(name = SysOrgInitTable.TABLE_NAME, comment = "组织限制",version = 1)
public class SysOrgInitTable  implements ITableBuildInfoService {

    public static final String TABLE_NAME="sys_organize";

    public static final String COLUMN_ORG_ID="org_id";


    @Override
    public List<TableColumnInfo> tableColumnInfoList(){
        List<TableColumnInfo> table = tableColumns(
                uniqueId(COLUMN_ORG_ID,"组织主键"),
                varColumn("org_name","组织"),

                column("    description            varchar(32)    default ''                not null comment '描述',"),
                column("    remark                 varchar(500)    default ''                not null comment '备注',"),
                column("    notepad                varchar(128)    default ''                not null comment '小记',"),
                column("    content                varchar(2000)                             null comment '详细说明',"),
                status()
                        .description(SksDictUtils.getDictInfo(Sks0Enable1Deactivate.class)),


                createUserId(),
                createTime(),
                updateUserId(),
                updateTime(),
                delFlag(),
                null
        );

        return table;
    }

    @Override
    public List<TableIndexInfo> tableIndexInfoList() {
        return tableIndexs(
                null
        );
    }
}
